package com.foreverwin.mes.lims.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.lims.model.InspecArrayItem;
import com.foreverwin.mes.lims.mapper.InspecArrayItemMapper;
import com.foreverwin.mes.lims.service.InspecArrayItemService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Levy
 * @since 2020-02-18
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class InspecArrayItemServiceImpl extends ServiceImpl<InspecArrayItemMapper, InspecArrayItem> implements InspecArrayItemService {


    @Autowired
    private InspecArrayItemMapper inspecArrayItemMapper;

    @Override
    public Page<InspecArrayItem> selectPage(FrontPage<InspecArrayItem> frontPage, InspecArrayItem inspecArrayItem) {
        EntityWrapper<InspecArrayItem> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(inspecArrayItem);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<InspecArrayItem> selectList(InspecArrayItem inspecArrayItem) {
        EntityWrapper<InspecArrayItem> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(inspecArrayItem);
        return super.selectList(queryWrapper);
    }

    /**
     * 删除检验项目下明细
     *
     * @param arrayBo
     * @return
     */
    public int deleteArrayItemByArrayBo(@Param("arrayBo") String arrayBo){
        return  inspecArrayItemMapper.deleteArrayItemByArrayBo( arrayBo );
    }

}